<template>
  <div>
    <h1>当前求和为:{{sum }}</h1>

    <h1>放大十倍当前求和为:{{ bigSum}}</h1>

    <h1>学校:{{ school}}</h1>
    <h1>科目:{{ subject}}</h1>
    <h1 style="color:red">Person项目人员数量{{ personList.length }}</h1>

    <select v-model.number="n">
      <option value="1">1</option>
      <option value="2">2</option>
      <option value="3">3</option>
    </select>
    <button @click="increase(n)">+</button>
    <button @click="decrease(n)">-</button>
    <button @click="increaseOdd(n)">当前求和奇数再加</button>
    <button @click="increaseWait(n)">等一等再加</button>
  </div>
</template>

<script>
import { mapState ,mapGetters,mapMutations,mapActions} from 'vuex';
export default {
  name: "Count",
  data() {
    return {
      n: 1
    };
  },
  computed: {

    //数组写法
    ...mapState(["sum","school","subject","personList"]),
    ...mapGetters(["bigSum"])
  },
  methods: {

    ...mapMutations({"increase":"JIA","decrease":"JIAN"}),


    ...mapActions({"increaseOdd":"odd","increaseWait":"wait"})


  }
};
</script>
<style scoped>
button {
  margin-left: 10px;
}
</style>
